<template>
    <z-block url="/do/list/task" :params="params">
        <template #default="task">
            <el-tab-pane label="履约任务" name="perform">
                <el-empty v-if="task == null" description="暂无数据"/>
                <el-timeline style="max-width: 600px">
                    <el-timeline-item v-for="(activity, index) in task" :key="index"
                                      :color="activity.status == 1 ? '#0bbd87' : '#FF0000'"
                                      :timestamp="new Date(activity.createGmt * 1000).toLocaleString()" placement="top">
                        <el-card>
                            <el-descriptions column="1">
                                <el-descriptions-item label="任务id">
                                    <z-text type="primary" :modelValue="activity.id" emit="taskDetail"/>
                                </el-descriptions-item>
                                <el-descriptions-item label="任务名称">{{ activity.title }}</el-descriptions-item>
                                <el-descriptions-item label="任务类型">
                                    <z-dict readonly :modelValue="activity.type" code="cfg_taskType"/>
                                </el-descriptions-item>
                                <el-descriptions-item label="任务执行人">
                                    <z-avatar :value="activity.executor" :plain="false"/>
                                </el-descriptions-item>
                                <el-descriptions-item label="任务状态">
                                    {{ activity.status == 0 ? '待完成' : '已完成' }}
                                </el-descriptions-item>
                                <el-descriptions-item label="任务说明">
                                    {{ activity.explain }}
                                </el-descriptions-item>
                            </el-descriptions>
                        </el-card>
                    </el-timeline-item>
                </el-timeline>
            </el-tab-pane>
        </template>
    </z-block>
</template>

<script>


export default {
    props: {
        params: Object,
    },
    data() {
        return {}
    },
}
</script>
